home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_emacs.idb / usr / freeware / info / sc-1.z / sc-1 (.txt)
GNU Info File  |  1998-10-27  |  48KB  |  837 lines

  1. This is Info file ../info/sc, produced by Makeinfo-1.64 from the input
  2. file sc.texi.
  3.    This document describes the Supercite Version 3.1 package for citing
  4. and attributing the replies for various GNU Emacs mail and news reading
  5. subsystems.
  6.    Copyright (C) 1993 Barry A
  7.  Warsaw
  8.    Permission is granted to make and distribute verbatim copies of this
  9. manual provided the copyright notice and this permission notice are
  10. preserved on all copies.
  11. File: sc,  Node: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  12.    This document describes the Supercite Version 3.1 package for citing
  13. and attributing the replies for various GNU Emacs mail and news reading
  14. subsystems.  The manual is divided into the following chapters.
  15. * Menu:
  16. * Introduction::
  17. * Citations::
  18. * Getting Connected::
  19. * Replying and Yanking::
  20. * Selecting an Attribution::
  21. * Configuring the Citation Engine::
  22. * Post-yank Formatting Commands::
  23. * Information Keys and the Info Alist::
  24. * Reference Headers::
  25. * Hints to MUA Authors::
  26. * Version 3 Changes::
  27. * Thanks and History::
  28. * The Supercite Mailing List::
  29. * Concept Index::
  30. * Command Index::
  31. * Key Index::
  32. * Variable Index::
  33. File: sc,  Node: Introduction,  Next: Usage Overview,  Prev: Top,  Up: Top
  34. Introduction
  35. ************
  36.    Supercite version 3.1 is a GNU Emacs package written entirely in
  37. Emacs Lisp. It interfaces to most of the commonly used Emacs mail user
  38. agents ("MUAs") and news user agents ("NUAs"), and provides
  39. sophisticated facilities for the citing and attributing of message
  40. replies.  Supercite has a very specific and limited role in the process
  41. of composing replies to both USENET network news and electronic mail.
  42.    The preferred way to spell Supercite is with a capital `S',
  43. lowercase `upercite'.  There are a few alternate spellings out there
  44. and I won't be terribly offended if you use them.  People often ask
  45. though...
  46. * Menu:
  47. * Usage Overview::
  48. * What Supercite Does Not Do::
  49. * What Supercite Does::
  50.    Supercite is only useful in conjunction with MUAs and NUAs such as
  51. VM, GNUS, RMAIL, etc
  52.  (hereafter referred to collectively as MUAs).
  53. Supercite is typically called by the MUA after a reply buffer has been
  54. setup.  Thereafter, Supercite's many commands and formatting styles are
  55. available in that reply buffer until the reply is sent.  Supercite is
  56. re-initialized in each new reply buffer.
  57.    Supercite is currently at major revision 3.1, and is known to work
  58. in the following environments:
  59. Emacs versions:
  60.          GNU Emacs 18.57 through 18.59, all Emacs 19,     all current Lucid
  61.      Emacs, and Epoch 4.
  62. MUAs:
  63.          VM 4.37 and beyond (including VM version 5), RMAIL, MH-E 3.7 and
  64.      beyond, PCMAIL.
  65. NUAs:
  66.          RNEWS, GNUS 3.12 and beyond, GNEWS.
  67.    For systems with version numbers, all known subsequent versions also
  68. work with Supercite.  For those systems without version numbers,
  69. Supercite probably works with any recently released version.  Note that
  70. only some of these systems will work with Supercite "out of the box."
  71. All others must overload interfacing routines to supply the necessary
  72. glue.  *Note Getting Connected:: for more details.
  73. File: sc,  Node: Usage Overview,  Next: What Supercite Does Not Do,  Prev: Introduction,  Up: Introduction
  74. Usage Overview
  75. ==============
  76.    Typical usage is as follows. You want to reply or followup to a
  77. message in your MUA. You will probably hit `r' (i.e., "reply") or `f'
  78. (i.e., "forward") to begin composing the reply.  In response, the MUA
  79. will create a reply buffer and initialize the outgoing mail headers
  80. appropriately.  The body of the reply will usually be empty at this
  81. point.  You now decide that you would like to include part of the
  82. original message in your reply. To do this, you "yank" the original
  83. message into the reply buffer, typically with a key stroke such as `C-c
  84. C-y'.  This sequence will invoke an MUA-specific function which fills
  85. the body of the reply with the original message and then "attributes"
  86. this text to its author.  This is called "citing" and its effect is to
  87. prefix every line from the original message with a special text tag.
  88. Most MUAs provide some default style of citing; by using Supercite you
  89. gain a wider flexibility in the look and style of citations.
  90. Supercite's only job is to cite the original message.
  91. File: sc,  Node: What Supercite Does Not Do,  Next: What Supercite Does,  Prev: Usage Overview,  Up: Introduction
  92. What Supercite Doesn't Do
  93. =========================
  94.    Because of this clear division of labor, there are useful features
  95. which are the sole responsibility of the MUA, even though it might seem
  96. that Supercite should provide them.  For example, many people would
  97. like to be able to yank (and cite) only a portion of the original
  98. message.  Since Supercite only modifies the text it finds in the reply
  99. buffer as set up by the MUA, it is the MUA's responsibility to do
  100. partial yanking.  *Note Reply Buffer Initialization::.
  101.    Another potentially useful thing would be for Supercite to set up the
  102. outgoing mail headers with information it gleans from the reply buffer.
  103. But by previously agreed upon convention, any text above the
  104. `mail-header-separator' which separates mail headers from message
  105. bodies cannot be modified by Supercite.  Supercite, in fact, doesn't
  106. know anything about the meaning of these headers, and never ventures
  107. outside the designated region. *Note Hints to MUA Authors:: for more
  108. details.
  109. File: sc,  Node: What Supercite Does,  Next: Citations,  Prev: What Supercite Does Not Do,  Up: Introduction
  110. What Supercite Does
  111. ===================
  112.    Supercite is invoked for the first time on a reply buffer via your
  113. MUA's reply or forward command.  This command will actually perform
  114. citations by calling a hook variable to which Supercite's top-level
  115. function `sc-cite-original' has been added.  When `sc-cite-original' is
  116. executed, the original message must be set up in a very specific way,
  117. but this is handled automatically by the MUA.  *Note Hints to MUA
  118. Authors::.
  119.    The first thing Supercite does, via `sc-cite-original', is to parse
  120. through the original message's mail headers.  It saves this data in an
  121. "information association list", or "info alist".  The information in
  122. this list is used in a number of places throughout Supercite.  *Note
  123. Information Keys and the Info Alist::.
  124.    After the mail header info is extracted, the headers are optionally
  125. removed ("nuked") from the reply.  Supercite then writes a "reference
  126. header" into the buffer.  This reference header is a string carrying
  127. details about the citation it is about to perform.
  128.    Next, Supercite visits each line in the reply, transforming the line
  129. according to a customizable "script".  Lines which were not previously
  130. cited in the original message are given a citation, while already cited
  131. lines remain untouched, or are coerced to your preferred style.
  132. Finally, Supercite installs a keymap into the reply buffer so that you
  133. have access to Supercite's post-yank formatting and reciting commands as
  134. you subsequently edit your reply.  You can tell that Supercite has been
  135. installed into the reply buffer because that buffer's modeline will
  136. display the minor mode string `SC'.
  137.    When the original message is cited by `sc-cite-original', it will
  138. (optionally) be filled by Supercite.  However, if you manually edit the
  139. cited text and want to re-fill it, you must use an add-on package such
  140. as `filladapt' or `gin-mode'.  These packages can recognize Supercited
  141. text and will fill them appropriately.  Emacs' built-in filling
  142. routines, e.g
  143.  `fill-paragraph', do not recognize cited text and will
  144. not re-fill them properly because it cannot guess the `fill-prefix'
  145. being used.  *Note Post-yank Formatting Commands:: for details.
  146.    As mentioned above, Supercite provides commands to recite or uncite
  147. regions of text in the reply buffer, and commands to perform other
  148. beautifications on the cited original text, maintaining consistent and
  149. informative citations throughout.  Supercite tries to be as configurable
  150. as possible to allow for a wide range of personalized citation styles,
  151. but it is also immediately useful with the default configuration, once
  152. it has been properly connected to your MUA.  *Note Getting Connected::
  153. for more details.
  154. File: sc,  Node: Citations,  Next: Citation Elements,  Prev: What Supercite Does,  Up: Top
  155. Citations
  156. *********
  157.    A "citation" is the acknowledgement of the original author of a mail
  158. message in the body of the reply.  There are two basic citation styles
  159. which Supercite supports.  The first, called "nested citations" is an
  160. anonymous form of citation; in other words, an indication is made that
  161. the cited line was written by someone *other* that the current message
  162. author (i.e., other than you, the person composing the reply), but no
  163. reference is made as to the identity of the original author.  This
  164. style should look familiar since its use on the net is widespread.
  165. Here's an example of what a message buffer would look like using nested
  166. citations after multiple replies:
  167.      >> John originally wrote this
  168.      >> and this as well
  169.      > Jane said that John didn't know
  170.      > what he was talking about
  171.      And that's what I think too.
  172. * Menu:
  173. * Citation Elements::
  174. * Recognizing Citations::
  175.    Note that multiple inclusions of the original messages result in a
  176. nesting of the ``>'' characters.  This can sometimes be quite confusing
  177. when many levels of citations are included since it may be difficult or
  178. impossible to figure out who actually participated in the thread, and
  179. multiple nesting of ``>'' characters can sometimes make the message
  180. very difficult for the eye to scan.
  181.    In "non-nested citations", each cited line begins with an
  182. informative string attributing that line to the original author. Only
  183. the first level of attribution will be shown; subsequent citations don't
  184. nest the citation strings. The above dialog might look like this when
  185. non-nested citations are used:
  186.      John> John originally wrote this
  187.      John> and this as well
  188.      Jane> Jane said that John didn't know
  189.      Jane> what he was talking about
  190.      And that's what I think too.
  191.    Notice here that my inclusion of Jane's inclusion of John's original
  192. message did not result in a line cited with `Jane>John>'.
  193.    Supercite supports both styles of citation, and the variable
  194. `sc-nested-citation-p' controls which style it will use when citing
  195. previously uncited text. When this variable is `nil' (the default),
  196. non-nested citations are used.  When non-`nil', nested citations are
  197. used.
  198. File: sc,  Node: Citation Elements,  Next: Recognizing Citations,  Prev: Citations,  Up: Citations
  199. Citation Elements
  200. =================
  201.    "Citation strings" are composed of one or more elements. Non-nested
  202. citations are composed of four elements, three of which are directly
  203. user definable.  The elements are concatenated together, in this order:
  204.   1. The "citation leader".  The citation leader is contained in the
  205.      variable `sc-citation-leader', and has the default value of a
  206.      string containing four spaces.
  207.   2. The "attribution string".  This element is supplied automatically
  208.      by Supercite, based on your preferences and the original message's
  209.      mail headers, though you may be asked to confirm Supercite's
  210.      choice.  *Note Selecting an Attribution:: for more details.
  211.   3. The "citation delimiter".  This string, contained in the variable
  212.      `sc-citation-delimiter' visually separates the citation from the
  213.      text of the line.  This variable has a default value of `">"' and
  214.      for best results, the string should consist of only a single
  215.      character.
  216.   4. The "citation separator".  The citation separator is contained in
  217.      the variable `sc-citation-separator', and has the default value of
  218.      a string containing a single space.
  219.    For example, suppose you were using the default values for the above
  220. variables, and Supercite provided the attribution string `Jane'.  In
  221. this case, the composed, non-nested citation string used might be
  222. something like `"    Jane> "'.  This citation string will be inserted
  223. in front of every line in the original message that is not already
  224. cited.
  225.    Nested citations, being simpler than non-nested citations, are
  226. composed of the same elements, sans the attribution string.  Supercite
  227. is smart enough to not put additional spaces between citation
  228. delimiters for multi-level nested citations.
  229. File: sc,  Node: Recognizing Citations,  Next: Getting Connected,  Prev: Citation Elements,  Up: Citations
  230. Recognizing Citations
  231. =====================
  232.    Supercite also recognizes citations in the original article, and can
  233. transform these already cited lines in a number of ways. This is how
  234. Supercite suppresses the multiple citing of non-nested citations.
  235. Recognition of cited lines is controlled by variables analogous to those
  236. that make up the citation string as mentioned previously.
  237.    The variable `sc-citation-leader-regexp' describes how citation
  238. leaders can look, by default it matches any number of spaces or tabs.
  239. Note that since the lisp function `looking-at' is used to do the
  240. matching, if you change this variable it need not start with a leading
  241. `"^"'.
  242.    Similarly, the variables `sc-citation-delimiter-regexp' and
  243. `sc-citation-separator-regexp' respectively describe how citation
  244. delimiters and separators can look.  They follow the same rule as
  245. `sc-citation-leader-regexp' above.
  246.    When Supercite composes a citation string, it provides the
  247. attribution automatically.  The analogous variable which handles
  248. recognition of the attribution part of citation strings is
  249. `sc-citation-root-regexp'.  This variable describes the attribution
  250. root for both nested and non-nested citations.  By default it can match
  251. zero-to-many alphanumeric characters (also ".", "-", and "_").  But in
  252. some situations, Supercite has to determine whether it is looking at a
  253. nested or non-nested citation.  Thus the variable
  254. `sc-citation-nonnested-root-regexp' is used to describe only non-nested
  255. citation roots.  It is important to remember that if you change
  256. `sc-citation-root-regexp' you should always also change
  257. `sc-citation-nonnested-root-regexp'.
  258.    Nemacs users: For best results, try setting
  259. `sc-citation-root-regexp' to:
  260.      "\\([-._a-zA-Z0-9]\\|\\cc\\|\\cC\\|\\ch\\|\\cH\\|\\ck\\|\\cK\\|\\ca\\|\\cg\\|\\cr\\|\\cu\\)*"
  261.    Mule users: For best results, try setting `sc-citation-root-regexp'
  262.      "\\([-._a-zA-Z0-9]\\|\\cj\\)*"
  263. File: sc,  Node: Information Keys and the Info Alist,  Next: Reference Headers,  Prev: Miscellaneous Commands,  Up: Top
  264. Information Keys and the Info Alist
  265. ***********************************
  266.    "Mail header information keys" are nuggets of information that
  267. Supercite extracts from the various mail headers of the original
  268. message, placed in the reply buffer by the MUA.  Information is kept in
  269. the "Info Alist" as key-value pairs, and can be retrieved for use in
  270. various places within Supercite, such as in header rewrite functions and
  271. attribution selection.  Other bits of data, composed and created by
  272. Supercite, are also kept as key-value pairs in this alist. In the case
  273. of mail fields, the key is the name of the field, omitting the trailing
  274. colon.  Info keys are always case insensitive (as are mail headers), and
  275. the value for a corresponding key can be retrieved from the alist with
  276. the `sc-mail-field' function.  Thus, if the following fields were
  277. present in the original article:
  278.      Date: 08 April 1991, 17:32:09 EST
  279.      Subject: Better get out your asbestos suit
  280. then, the following lisp constructs return:
  281.      (sc-mail-field "date")
  282.      ==> "08 April 1991, 17:32:09 EST"
  283.      
  284.      (sc-mail-field "subject")
  285.      ==> "Better get out your asbestos suit"
  286.    Since the argument to `sc-mail-field' can be any string, it is
  287. possible that the mail field will not be present on the info alist
  288. (possibly because the mail header was not present in the original
  289. message). In this case, `sc-mail-field' will return the value of the
  290. variable `sc-mumble'.
  291.    Supercite always places all mail fields found in the yanked original
  292. article into the info alist.  If possible, Supercite will also places
  293. the following keys into the info alist:
  294. `"sc-attribution"'
  295.      the selected attribution string.
  296. `"sc-citation"'
  297.      the non-nested citation string.
  298. `"sc-from-address"'
  299.      email address extracted from the `From:' field.
  300. `"sc-reply-address"'
  301.      email address extracted from the `Reply-To:' field.
  302. `"sc-sender-address"'
  303.      email address extracted from the `Sender:' field.
  304. `"sc-emailname"'
  305.      email terminus extracted from the `From:' field.
  306. `"sc-initials"'
  307.      the author's initials.
  308. `"sc-author"'
  309.      the author's full name.
  310. `"sc-firstname"'
  311.      the author's first name.
  312. `"sc-lastname"'
  313.      the author's last name.
  314. `"sc-middlename-1"'
  315.      the author's first middle name.
  316.    If the author's name has more than one middle name, they will appear
  317. as info keys with the appropriate index (e.g., `"sc-middlename-2"',
  318. ...).  *Note Selecting an Attribution::.
  319. File: sc,  Node: Reference Headers,  Next: The Built-in Header Rewrite Functions,  Prev: Information Keys and the Info Alist,  Up: Top
  320. Reference Headers
  321. *****************
  322.    Supercite will insert an informative "reference header" at the
  323. beginning of the cited body of text, which display more detail about the
  324. original article and provides the mapping between the attribution and
  325. the original author in non-nested citations.  Whereas the citation
  326. string usually only contains a portion of the original author's name,
  327. the reference header can contain such information as the author's full
  328. name, email address, the original article's subject, etc.  In fact any
  329. information contained in the info alist can be inserted into a reference
  330. header.
  331. * Menu:
  332. * The Built-in Header Rewrite Functions::
  333. * Electric References::
  334.    There are a number of built-in "header rewrite functions" supplied
  335. by Supercite, but you can write your own custom header rewrite functions
  336. (perhaps using the built-in ones as examples). The variable
  337. `sc-rewrite-header-list' contains the list of such header rewrite
  338. functions.  This list is consulted both when inserting the initial
  339. reference header, and when displaying "electric references".  *Note
  340. Electric References::.
  341.    When Supercite is initially run on a reply buffer (via
  342. `sc-cite-original'), it will automatically call one of these functions.
  343. The one it uses is defined in the variable `sc-preferred-header-style'.
  344. The value of this variable is an integer which is an index into the
  345. `sc-rewrite-header-list', beginning at zero.
  346. File: sc,  Node: The Built-in Header Rewrite Functions,  Next: Electric References,  Prev: Reference Headers,  Up: Reference Headers
  347. The Built-in Header Rewrite Functions
  348. =====================================
  349.    Below are examples of the various built-in header rewrite functions.
  350. Please note the following: first, the text which appears in the
  351. examples below as INFOKEY indicates that the corresponding value of the
  352. info key from the info alist will be inserted there.  (*Note
  353. Information Keys and the Info Alist::).  For example, in
  354. `sc-header-on-said' below, DATE and FROM correspond to the values of the
  355. `Date:' and `From:' mail headers respectively.
  356.    Also, the string `">>>>>"' below is really the value of the variable
  357. `sc-reference-tag-string'.  This variable is used in all built-in
  358. header rewrite functions, and you can customize its value to change the
  359. tag string globally.
  360.    Finally, the references headers actually written may omit certain
  361. parts of the header if the info key associated with INFOKEY is not
  362. present in the info alist.  In fact, for all built-in headers, if the
  363. `From:' field is not present in the mail headers, the entire reference
  364. header will be omitted (but this usually signals a serious problem
  365. either in your MUA or in Supercite's installation).
  366. `sc-no-header'
  367.      This function produces no header. It should be used instead of
  368.      `nil' to produce a blank header.  This header can possibly contain
  369.      a blank line after the `mail-header-separator' line.
  370. `sc-no-blank-line-or-header'
  371.      This function is similar to `sc-no-header' except that any blank
  372.      line after the `mail-header-separator' line will be removed.
  373. `sc-header-on-said'
  374.      `>>>>> On DATE, FROM said:'
  375. `sc-header-inarticle-writes'
  376.      `>>>>> In article MESSAGE-ID, FROM writes:'
  377. `sc-header-regarding-adds'
  378.      `>>>>> Regarding SUBJECT; FROM adds:'
  379. `sc-header-attributed-writes'
  380.      `>>>>> "SC-ATTRIBUTION" == SC-AUTHOR <SC-REPLY-ADDRESS> writes:'
  381. `sc-header-author-writes'
  382.      `>>>>> SC-AUTHOR writes:'
  383. `sc-header-verbose'
  384.      `>>>>> On DATE,'
  385.      `>>>>> SC-AUTHOR'
  386.      `>>>>> from the organization of ORGANIZATION'
  387.      `>>>>> who can be reached at: SC-REPLY-ADDRESS'
  388.      `>>>>> (whose comments are cited below with: "SC-CITE")'
  389.      `>>>>> had this to say in article MESSAGE-ID'
  390.      `>>>>> in newsgroups NEWSGROUPS'
  391.      `>>>>> concerning the subject of SUBJECT'
  392.      `>>>>> see REFERENCES for more details'
  393. File: sc,  Node: Electric References,  Next: Hints to MUA Authors,  Prev: The Built-in Header Rewrite Functions,  Up: Reference Headers
  394. Electric References
  395. ===================
  396.    By default, when Supercite cites the original message for the first
  397. time, it just goes ahead and inserts the reference header indexed by
  398. `sc-preferred-header-style'.  However, you may want to select different
  399. reference headers based on the type of reply or forwarding you are
  400. doing. You may also want to preview the reference header before
  401. deciding whether to insert it into the reply buffer or not. Supercite
  402. provides an optional "electric reference" mode which you can drop into
  403. to give you this functionality.
  404.    If the variable `sc-electric-references-p' is non-`nil', Supercite
  405. will bring up an electric reference mode buffer and place you into a
  406. recursive edit.  The electric reference buffer is read-only, so you
  407. cannot directly modify the reference text until you exit electric
  408. references and insert the text into the reply buffer.  But you can cycle
  409. through all the reference header rewrite functions in your
  410. `sc-rewrite-header-list'.
  411.    You can also set a new preferred header style, jump to any header, or
  412. jump to the preferred header. The header will be shown in the electric
  413. reference buffer and the header index and function name will appear in
  414. the echo area.
  415.    The following commands are available while in electric reference mode
  416. (shown here with their default key bindings):
  417. `sc-eref-next' (`n')
  418.      Displays the next reference header in the electric reference
  419.      buffer. If the variable `sc-electric-circular-p' is non-`nil',
  420.      invoking `sc-eref-next' while viewing the last reference header in
  421.      the list will wrap around to the first header.
  422. `sc-eref-prev' (`p')
  423.      Displays the previous reference header in the electric reference
  424.      buffer.  If the variable `sc-electric-circular-p' is non-`nil',
  425.      invoking `sc-eref-prev' will wrap around to the last header.
  426. `sc-eref-goto' (`g')
  427.      Goes to a specified reference header.  The index (into the
  428.      `sc-rewrite-header-list') can be specified as a numeric argument to
  429.      the command.  Otherwise, Supercite will query you for the index in
  430.      the minibuffer.
  431. `sc-eref-jump' (`j')
  432.      Display the preferred reference header, i.e., the one indexed by
  433.      the current value of `sc-preferred-header-style'.
  434. `sc-eref-setn' (`s')
  435.      Set the preferred reference header (i.e.,
  436.      `sc-preferred-header-style') to the currently displayed header.
  437. `sc-eref-exit' (LFD, RET, and ESC C-c)
  438.      Exit from electric reference mode and insert the current header
  439.      into the reply buffer.
  440. `sc-eref-abort' (`q', `x')
  441.      Exit from electric reference mode without inserting the current
  442.      header.
  443. Supercite will execute the hook `sc-electric-mode-hook' before entering
  444. electric reference mode.
  445. File: sc,  Node: Getting Connected,  Next: Emacs 19 MUAs,  Prev: Recognizing Citations,  Up: Top
  446. Getting Connected
  447. *****************
  448.    Hitting `C-c C-y' in your MUA's reply buffer yanks and cites the
  449. original message into the reply buffer.  In reality, the citation of the
  450. original message is performed via a call through a configurable hook
  451. variable.  The name of this variable has been agreed to in advance as
  452. part of the "citation interface specification".  By default this hook
  453. variable has a `nil' value, which the MUA recognizes to mean, "use your
  454. default citation function".  When you add Supercite's citation function
  455. to the hook, thereby giving the variable a non-`nil' value, it tells
  456. the MUA to run the hook via `run-hooks' instead of using the default
  457. citation.
  458. * Menu:
  459. * Emacs 19 MUAs::
  460. * Emacs 18 MUAs::
  461. * MH-E with any Emacsen::
  462. * VM with any Emacsen::
  463. * GNEWS with any Emacsen::
  464. * Overloading for Non-conforming MUAs::
  465.    Early in Supercite's development, the Supercite author, a few MUA
  466. authors, and some early Supercite users got together and agreed upon a
  467. standard interface between MUAs and citation packages (of which
  468. Supercite is currently the only known add-on :-).  With the recent
  469. release of the Free Software Foundation's GNU Emacs 19, the interface
  470. has undergone some modification and it is possible that not all MUAs
  471. support the new interface yet.  Some support only the old interface and
  472. some do not support the interface at all.  Still, it is possible for all
  473. known MUAs to use Supercite, and the following sections will outline the
  474. procedures you need to follow.
  475.    To learn exactly how to connect Supercite to the software systems you
  476. are using, read the appropriate following sections.  For details on the
  477. interface specifications, or if you are writing or maintaining an MUA,
  478. *note Hints to MUA Authors::..
  479.    The first thing that everyone should do, regardless of the MUA you
  480. are using is to set up Emacs so it will load Supercite at the
  481. appropriate time.  You can either dump Supercite into your Emacs binary
  482. (ask your local Emacs guru how to do this if you don't know), or you
  483. can set up an "autoload" for Supercite.  To do the latter, put the
  484. following in your `.emacs' file:
  485.      (autoload 'sc-cite-original     "supercite" "Supercite 3.1" t)
  486.      (autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t)
  487.    The function `sc-cite-original' is the top-level Supercite function
  488. designed to be run from the citation hook.  It expects `point' and
  489. `mark' to be set around the region to cite, and it expects the original
  490. article's mail headers to be present within this region.  Note that
  491. Supercite *never* touches any text outside this region.  Note further
  492. that for Emacs 19, the region need not be active for `sc-cite-original'
  493. to do its job.  *Note Hints to MUA Authors::.
  494.    The other step in the getting connected process is to make sure your
  495. MUA calls `sc-cite-original' at the right time.  As mentioned above,
  496. some MUAs handle this differently.  Read the sections that follow
  497. pertaining to the MUAs you are using.
  498.    One final note.  After Supercite is loaded into your Emacs session,
  499. it runs the hook `sc-load-hook'.  You can put any customizations into
  500. this hook since it is only run once.  This will not work, however, if
  501. your Emacs maintainer has put Supercite into your dumped Emacs' image.
  502. In that case, you can use the `sc-pre-hook' variable, but this will get
  503. executed every time `sc-cite-original' is called.  *Note Reply Buffer
  504. Initialization::.
  505. File: sc,  Node: Emacs 19 MUAs,  Next: Emacs 18 MUAs,  Prev: Getting Connected,  Up: Getting Connected
  506. GNUS, RMAIL, or RNEWS with any Emacs 19
  507. =======================================
  508.    These MUAs, distributed with Emacs and with Lucid Emacs, use Emacs's
  509. built-in yanking facility, which provides the citing hook variable
  510. `mail-citation-hook'.  By default, this hook's value is `nil', but by
  511. adding the following to your `.emacs' file, you can tell these MUAs to
  512. use Supercite to perform the citing of the original message:
  513.      (add-hook 'mail-citation-hook 'sc-cite-original)
  514.    GNUS users may also want to add the following bit of lisp as well.
  515. This prevents GNUS from inserting its default attribution header.
  516. Otherwise, both GNUS and Supercite will insert an attribution header:
  517.      (setq news-reply-header-hook nil)
  518. File: sc,  Node: Emacs 18 MUAs,  Next: MH-E with any Emacsen,  Prev: Emacs 19 MUAs,  Up: Getting Connected
  519. GNUS, RMAIL, PCMAIL, RNEWS with Emacs 18 or Epoch 4
  520. ===================================================
  521.    These MUAs use Emacs' built-in yanking and citing routines,
  522. contained in the `sendmail.el' file.  `sendmail.el' for Emacs 18, and
  523. its derivative Epoch 4, do not know anything about the citation
  524. interface required by Supercite.  To connect Supercite to any of these
  525. MUAs under Emacs 18 or Epoch 4, you should first *note Overloading for
  526. Non-conforming MUAs::..  Then follow the directions for using these
  527. MUAs under Emacs 19.  *Note Emacs 19 MUAs::.
  528.    Note that those instructions will tell you to use the function
  529. `add-hook'. This function is new with Emacs 19 and you will not have it
  530. by default if you are running Emacs 18 or Epoch 4.  You can either
  531. substitute the appropriate call to `setq', or you can use the
  532. `add-hook' function that is provided in the `sc-unsupp.el' file of
  533. unsupported Supercite hacks and ideas.  Or you can upgrade to some
  534. Emacs 19 variant!  :-)
  535.    To use `setq' instead of `add-hook', you would, for example, change
  536. this:
  537.      (add-hook 'mail-citation-hook 'sc-cite-original)
  538.    to:
  539.      (setq mail-citation-hook 'sc-cite-original)
  540.    Note the lack of of a single quote on the first argument to `setq'.
  541. File: sc,  Node: MH-E with any Emacsen,  Next: VM with any Emacsen,  Prev: Emacs 18 MUAs,  Up: Getting Connected
  542. MH-E with any Emacsen
  543. =====================
  544.    MH-E 4.x conforms to the `mail-citation-hook' interface supported by
  545. other MUAs.  At the time of this writing, MH-E 4.0 has not been
  546. released, but if you have it, put this in your `.emacs' file to connect
  547. Supercite and MH-E 4.x:
  548.      (add-hook 'mail-citation-hook 'sc-cite-original)
  549.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  550. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  551. proceed without `add-hook'.
  552.    MH-E version 3.x uses a slightly different interface than other MUAs.
  553. MH-E provides a hook variable `mh-yank-hooks', but it doesn't act like
  554. a hook, and doing an `add-hook' will not work.
  555.    To connect Supercite to MH-E 3.x, you should instead add the
  556. following to your `.emacs' file:
  557.      (add-hook 'mh-yank-hooks 'sc-cite-original)
  558.    You also need to make sure that MH-E includes all the original mail
  559. headers in the yanked message.  The variable that controls this is
  560. `mh-yank-from-start-of-msg'.  By default, this variable has the value
  561. `t', which tells MH-E to include all the mail headers when yanking the
  562. original message.  Before you switched to using Supercite, you may have
  563. set this variable to other values so as not to include the mail headers
  564. in the yanked message.  Since Supercite requires these headers (and
  565. cleans them out for you), you need to make sure the value is `t'.  This
  566. lisp, in your `.emacs' file will do the trick:
  567.      (setq mh-yank-from-start-of-msg t)
  568.    Note that versions of MH-E before 3.7 did not provide the
  569. `mh-yank-hooks' variable.  Your only option is to upgrade to MH-E
  570. version 3.7 or later.
  571. File: sc,  Node: VM with any Emacsen,  Next: GNEWS with any Emacsen,  Prev: MH-E with any Emacsen,  Up: Getting Connected
  572. VM with any Emacsen
  573. ===================
  574.    Since release 4.40, VM has supported the citation interface required
  575. by Supercite.  But since the interface has changed recently the details
  576. of getting connected differ with the version of VM you are using.
  577.    If you are running any release of VM after 4.40, you can add the
  578. following to your `.emacs' to connect Supercite with VM:
  579.      (add-hook 'mail-yank-hooks 'sc-cite-original)
  580.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  581. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  582. proceed without `add-hook'.
  583.    Since version 5.34, VM has supported the newer `mail-citation-hook'
  584. interface, but `mail-yank-hooks' is still being supported for backward
  585. compatibility.  If you are running a newer version of VM and you want
  586. to maintain consistency with other MUAs, use this bit of code instead:
  587.      (add-hook 'mail-citation-hook 'sc-cite-original)
  588. File: sc,  Node: GNEWS with any Emacsen,  Next: Overloading for Non-conforming MUAs,  Prev: VM with any Emacsen,  Up: Getting Connected
  589. GNEWS with any Emacsen
  590. ======================
  591.    As far as I know, no version of GNEWS supports the citation interface
  592. required by Supercite.  To connect Supercite with GNEWS, please first
  593. *note Overloading for Non-conforming MUAs::..
  594.    After you have followed the directions in that section.  You should
  595. add the following lisp code to your `.emacs' file:
  596.      (add-hook 'mail-citation-hook 'sc-cite-original)
  597.    Note that if you are using Emacs 18 or Epoch 4, you will not have the
  598. `add-hook' function.  *Note Emacs 18 MUAs:: for details on how to
  599. proceed without `add-hook'.
  600. File: sc,  Node: Overloading for Non-conforming MUAs,  Next: Replying and Yanking,  Prev: GNEWS with any Emacsen,  Up: Getting Connected
  601. Overloading for Non-conforming MUAs
  602. ===================================
  603.    As mentioned elsewhere, some MUAs do not provide the necessary hooks
  604. to connect with Supercite.  Supercite version 3.1 provides an
  605. unsupported mechanism, called "overloading" which redefines certain key
  606. functions in the MUA, so that it will call the `mail-citation-hook'
  607. variable instead of the MUA's default hard-coded citing routines.  Since
  608. most newer versions of the known MUAs support the `mail-citation-hook'
  609. variable, it is recommended that you upgrade if at all possible.  But
  610. if you can't upgrade, at least you're not out of luck!  Once you set up
  611. overloading properly, you should follow the directions for connecting
  612. Supercite to the Emacs 19 MUAs.  *Note Emacs 19 MUAs::.
  613.    Users of Bob Weiner's Hyperbole package take note.  Hyperbole
  614. provides the necessary overloads (and a whole lot more!) and you can
  615. potentially clobber it if you were to load Supercite's overloading after
  616. Hyperbole's.  For this reason, Supercite will *not* perform any
  617. overloading if it finds the variable `hyperb:version' is `boundp' (i.e.
  618. it exists because Hyperbole has been loaded into your Emacs session).
  619. If this is the case, Supercite will display a warning message in the
  620. minibuffer.  You should consult the Hyperbole manual for further
  621. details.
  622.    Overloading involves the re-definition of the citing function with
  623. the new, `mail-citation-hook' savvy version.  The function in
  624. `sc-oloads.el' that does this is `sc-perform-overloads'.  This function
  625. is smart enough to only overload the MUA functions when it is
  626. absolutely necessary, based on the version numbers it can figure out.
  627. Also, `sc-perform-overloads' will only install the new functions once.
  628. It is also smart enough to do nothing if the MUA is not yet loaded.
  629.    The tricky part is finding the right time and place to perform the
  630. overloading.  It must be done after the MUA has been loaded into your
  631. Emacs session, but before the first time you try to yank in a message.
  632. Fortunately, this has been figured out for you.
  633.    If you must overload, you should put the following lisp code in your
  634. `.emacs' file, to make sure the `sc-oloads.el' file gets loaded at the
  635. right time:
  636.      (autoload 'sc-perform-overloads "sc-oloads" "Supercite 3.1" t)
  637.    Then you must make sure that the function `sc-perform-overloads'
  638. gets run at the right time.  For GNUS, put this in your `.emacs' file:
  639.      (setq news-reply-mode-hook 'sc-perform-overloads)
  640.      (setq mail-setup-hook 'sc-perform-overloads)
  641.    If you are using RNEWS, put this in your `.emacs' file:
  642.      (setq news-reply-mode-hook 'sc-perform-overloads)
  643.    If you are using RMAIL or PCMAIL, put this in your `.emacs' file:
  644.      (setq mail-setup-hook 'sc-perform-overloads)
  645.    If you are using GNEWS, put this in your `.emacs' file:
  646.      (setq news-reply-mode-hook 'sc-perform-overloads)
  647.      (setq gnews-ready-hook 'sc-perform-overloads)
  648.    Now go back and follow the directions for getting the Emacs 19 MUAs
  649. connected to Supercite.  Be sure to *note Emacs 18 MUAs::. on
  650. substitutes for Emacs 19's `add-hook' function.
  651. File: sc,  Node: Replying and Yanking,  Next: Reply Buffer Initialization,  Prev: Overloading for Non-conforming MUAs,  Up: Top
  652. Replying and Yanking
  653. ********************
  654.    This chapter explains what happens when you reply and yank an
  655. original message from an MUA.
  656. * Menu:
  657. * Reply Buffer Initialization::
  658. * Filling Cited Text::
  659. File: sc,  Node: Reply Buffer Initialization,  Next: Filling Cited Text,  Prev: Replying and Yanking,  Up: Replying and Yanking
  660. Reply Buffer Initialization
  661. ===========================
  662.    Executing `sc-cite-original' performs the following steps as it
  663. initializes the reply buffer:
  664.   1. *Runs `sc-pre-hook'.* This hook variable is run before
  665.      `sc-cite-original' does any other work.  You could conceivably use
  666.      this hook to set certain Supercite variables based on the reply
  667.      buffer's mode or name (i.e., to do something different based on
  668.      whether you are replying or following up to an article).
  669.   2. *Inserts Supercite's keymap.* Supercite provides a number of
  670.      commands for performing post-yank modifications to the reply
  671.      buffer.  These commands are installed on Supercite's top-level
  672.      keymap.  Since Supercite has to interface with a wide variety of
  673.      MUAs, it does not install all of its commands directly into the
  674.      reply buffer's keymap.  Instead, it puts its commands on a keymap
  675.      prefix, then installs this prefix onto the buffer's keymap.  What
  676.      this means is that you typically have to type more characters to
  677.      invoke a Supercite command, but Supercite's keybindings can be
  678.      made much more consistent across MUAs.
  679.      You can control what key Supercite uses as its keymap prefix by
  680.      changing the variable `sc-mode-map-prefix'.  By default, this
  681.      variable is set to `C-c C-p'; a finger twister perhaps, but
  682.      unfortunately the best default due to the scarcity of available
  683.      keybindings in many MUAs.
  684.   3. *Turns on Supercite minor mode.* The modeline of the reply buffer
  685.      should indicate that Supercite is active in that buffer by
  686.      displaying the string `SC'.
  687.   4. *Sets the "Undo Boundary".* Supercite sets an undo boundary before
  688.      it begins to modify the original yanked text.  This allows you to
  689.      easily undo Supercite's changes to affect alternative citing
  690.      styles.
  691.   5. *Processes the the mail headers.* All previously retrieved info
  692.      key-value pairs are deleted from the info alist, then the mail
  693.      headers in the body of the yanked message are scanned. Info
  694.      key-value pairs are created for each header found. Also, such
  695.      useful information as the author's name and email address are
  696.      extracted.  If the variable `sc-mail-warn-if-non-rfc822-p' is
  697.      non-`nil', then Supercite will warn you if it finds a mail header
  698.      that does not conform to RFC822.  This is rare and indicates a
  699.      problem either with your MUA or the original author's MUA, or some
  700.      MTA (mail transport agent) along the way.
  701.      Once the info keys have been extracted from the mail headers, the
  702.      headers are nuked from the reply buffer.  You can control exactly
  703.      which headers are removed or kept, but by default, all headers are
  704.      removed.
  705.      There are two variables which control mail header nuking.  The
  706.      variable `sc-nuke-mail-headers' controls the overall behavior of
  707.      the header nuking routines.  By setting this variable to `'all',
  708.      you automatically nuke all mail headers.  Likewise, setting this
  709.      variable to `'none' inhibits nuking of any mail headers.  In
  710.      between these extremes, you can tell Supercite to nuke only a
  711.      specified list of mail headers by setting this variable to
  712.      `'specified', or to keep only a specified list of headers by
  713.      setting it to `'keep'.
  714.      If `sc-nuke-mail-headers' is set to `'specified' or `'keep', then
  715.      the variable `sc-nuke-mail-header-list' is consulted for the list
  716.      of headers to nuke or keep.  This variable contains a list of
  717.      regular expressions.  If the mail header line matches a regular
  718.      expression in this list, the header will be nuked or kept.  The
  719.      line is matched against the regexp using `looking-at' rooted at
  720.      the beginning of the line.
  721.      If the variable `sc-blank-lines-after-headers' is non-`nil', it
  722.      contains the number of blank lines remaining in the buffer after
  723.      mail headers are nuked.  By default, only one blank line is left
  724.      in the buffer.
  725.   6. *Selects the attribution and citation strings.* Once the mail
  726.      headers have been processed, Supercite selects a attribution
  727.      string and a citation string which it will use to cite the
  728.      original message.  *Note Selecting an Attribution:: for details.
  729.   7. *Cites the message body.* After the selection of the attribution
  730.      and citation strings, Supercite cites the original message by
  731.      inserting the citation string prefix in front of every uncited
  732.      line.  You may not want Supercite to automatically cite very long
  733.      messages however.  For example, some email could contain a smaller
  734.      header section followed by a huge uuencoded message.  It wouldn't
  735.      make sense to cite the uuencoded message part when responding to
  736.      the original author's short preface.  For this reason, Supercite
  737.      provides a variable which limits the automatic citation of long
  738.      messages to a certain maximum number of lines.  The variable is
  739.      called `sc-cite-region-limit'.  If this variable contains an
  740.      integer, messages with more lines that this will not be cited at
  741.      all, and a warning message will be displayed.  Supercite has
  742.      performed everything necessary, though, for you to manually cite
  743.      only the small portion of the original message that you want to
  744.      use.
  745.      If `sc-cite-region-limit' contains a non-`nil' value, the original
  746.      message will always be cited, regardless of its size.  If the
  747.      variable contains the value `nil', the region will never be cited
  748.      automatically.  Use this if you always want to be able to edit and
  749.      cite the message manually.
  750.      The variable `sc-cite-blank-lines-p' controls whether blank lines
  751.      in the original message should be cited or not.  If this variable
  752.      is non-`nil', blank lines will be cited just like non-blank lines.
  753.      Otherwise, blank lines will be treated as paragraph separators.
  754.      Citing of the original message is highly configurable. Supercite's
  755.      default setup does a pretty good job of citing many common forms of
  756.      previously cited messages.  But there are as many citation styles
  757.      out there as people on the net, or just about!  It would be
  758.      impossible for Supercite to anticipate every style in existence,
  759.      and you probably wouldn't encounter them all anyway.  But you can
  760.      configure Supercite to recognize those styles you see often.
  761.      *Note Configuring the Citation Engine:: for details.
  762.   8. *Runs `sc-post-hook'.* This variable is very similar to
  763.      `sc-pre-hook', except that it runs after `sc-cite-original' is
  764.      finished. This hook is provided mostly for completeness and
  765.      backward compatibility. Perhaps it could be used to reset certain
  766.      variables set in `sc-pre-hook'.
  767. File: sc,  Node: Filling Cited Text,  Next: Selecting an Attribution,  Prev: Reply Buffer Initialization,  Up: Replying and Yanking
  768. Filling Cited Text
  769. ==================
  770.    Supercite will automatically fill newly cited text from the original
  771. message unless the variable `sc-auto-fill-region-p' has a `nil' value.
  772. Supercite will also re-fill paragraphs when you manually cite or
  773. re-cite text.
  774.    However, during normal editing, Supercite itself cannot be used to
  775. fill paragraphs.  This is a change from version 2.  There are other
  776. add-on lisp packages which do filling much better than Supercite ever
  777. did.  The two best known are "filladapt" and "gin-mode".  Both work well
  778. with Supercite and both are available at the normal Emacs Lisp archive
  779. sites.  "gin-mode" works pretty well out of the box, but if you use
  780. "filladapt", you may want to run the function `sc-setup-filladapt' from
  781. your `sc-load-hook'.  This simply makes "filladapt" a little more
  782. Supercite savvy than its default setup.
  783.    Also, Supercite will collapse leading whitespace between the citation
  784. string and the text on a line when the variable `sc-fixup-whitespace-p'
  785. is non-`nil'.  The default value for this variable is `nil'.
  786.    Its important to understand that Supercite's automatic filling
  787. (during the initial citation of the reply) is very fragile.  That is
  788. because figuring out the `fill-prefix' for a particular paragraph is a
  789. really hard thing to do automatically.  This is especially the case when
  790. the original message contains code or some other text where leading
  791. whitespace is important to preserve.  For this reason, many Supercite
  792. users typically run with `sc-auto-fill-region-p' (and possibly also
  793. `sc-fixup-whitespace-p') set to `nil'.  They then manually fill each
  794. cited paragraph in the reply buffer.
  795.    I usually run with both these variables containing their default
  796. values.  When Supercite's automatic filling breaks on a particular
  797. message, I will use Emacs' undo feature to undo back before the
  798. citation was applied to the original message.  Then I'll toggle the
  799. variables and manually cite those paragraphs that I don't want to fill
  800. or collapse whitespace on.  *Note Variable Toggling Shortcuts::.
  801.    If you find that Supercite's automatic filling is just too fragile
  802. for your tastes, you might consider one of these alternate approaches.
  803. Also, to make life easier, a shortcut function to toggle the state of
  804. both of these variables is provided on the key binding `C-c C-p C-p'
  805. (with the default value of `sc-mode-map-prefix'; *note Post-yank
  806. Formatting Commands::.).
  807.    You will noticed that the minor mode string will show the state of
  808. these variables as qualifier characters. When both variables are `nil',
  809. the Supercite minor mode string will display `SC'.  When just
  810. `sc-auto-fill-region-p' is non-`nil', the string will display `SC:f',
  811. and when just `sc-fixup-whitespace-p' is non-`nil', the string will
  812. display `SC:w'.  When both variables are non-`nil', the string will
  813. display `SC:fw'.  Note that the qualifiers chosen are mnemonics for the
  814. default bindings of the toggling function for each respective variable.
  815. *Note Variable Toggling Shortcuts::.
  816.    Why are these variables not set to `nil' by default?  It is because
  817. many users won't manually fill paragraphs that are Supercited, and there
  818. have been widespread complaints on the net about mail and news messages
  819. containing lines greater than about 72 characters.  So the default is to
  820. fill cited text.
  821. File: sc,  Node: Selecting an Attribution,  Next: Attribution Preferences,  Prev: Filling Cited Text,  Up: Top
  822. Selecting an Attribution
  823. ************************
  824.    As you know, the attribution string is the part of the author's name
  825. that will be used to composed a non-nested citation string. Supercite
  826. scans the various mail headers present in the original article and uses
  827. a number of heuristics to extract strings which it puts into the
  828. "attribution association list" or "attribution alist". This is
  829. analogous, but different than, the info alist previously mentioned. Each
  830. element in the attribution alist is a key-value pair containing such
  831. information as the author's first name, middle names, and last name, the
  832. author's initials, and the author's email terminus.
  833. * Menu:
  834. * Attribution Preferences::
  835. * Anonymous Attributions::
  836. * Author Names::
  837.